<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<div th:replace="fragment/js::js"> </div>
<body>


<div class="layui-container">
    <div class="layui-row">
        <div class="layui-col-md5"> &nbsp;</div>
        <div class="layui-col-md3" style="margin-top:200px;text-align: center">
            <h2>注册界面</h2>
            <input id="use" type="text" name="title" style="margin-top: 20px" required lay-verify="required"
                   placeholder="用户名" autocomplete="off" class="layui-input">

            <input id="pwd" type="text" name="title" style="margin-top: 15px"  required lay-verify="required"
                   placeholder="密码" autocomplete="off" class="layui-input">

            <button id="reg" type="submit" style="margin-top: 20px" class="layui-btn layui-btn-radius">提交</button>
        </div>
        <div class="layui-col-md4">&nbsp;</div>
    </div>
</div>
<script>
    layui.use(function () {
        var $=layui.$
    })
    $("#reg").click(function () {
        let username = $("#use").val()
        let password = $("#pwd").val()
        $.post("/reg",{"nickName":username,"password":password},function (data) {
            console.log(data)
        })
    })


</script>



</body>
</html>